package com.dk.service.impl;

import com.dk.mapper.SslCourseDetailsMapper;
import com.dk.pojo.SslCourseDetails;
import com.dk.service.SslCourseDetailsService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@DubboService
@Service
public class SslCourseDetailsServiceImpl implements SslCourseDetailsService {
    @Autowired
    private SslCourseDetailsMapper sslCourseDetailsMapper;
    @Override
    public List<SslCourseDetails> selectAll() {
        return sslCourseDetailsMapper.selectByExample(null);
    }

    @Override
    public void insertCourse(SslCourseDetails course) {
        sslCourseDetailsMapper.insertSelective(course);
    }

    @Override
    public SslCourseDetails selectById(Integer id) {
        SslCourseDetails sslCourseDetails = sslCourseDetailsMapper.selectByPrimaryKey(id);
        return sslCourseDetails;
    }

    @Override
    public void deleteById(Integer id) {
        sslCourseDetailsMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void updateCourse(SslCourseDetails c) {
        sslCourseDetailsMapper.updateByPrimaryKeySelective(c);
    }
}
